'use strict';
define(function(require, exports, module) {

    // app.directive('player', function() {
    //     return {
    //         'restrict': 'E',
    //         'replace': true,
    //         templateUrl: "tpl/player.html",
    //         link: function(scope, element, attrs) {

    //         }
    //     };
    // });

    exports.init = function(app){
        console.info("load home-nav...");
        console.info(app);
        app.register.directive("homeNav", function() {
            return {
                'restrict': 'E',
                'replace': false,
                templateUrl: "./app/home/directive/home-nav/view/home-nav.html",
                controller: function($scope, $element) {
                    var homeNavItems = [];
                    var allItems = $scope.AllNavItems;

                    angular.forEach(allItems, function(item){
                        if(item.state.indexOf("home.") == 0 && !item['hidden']){
                            homeNavItems.push(item);
                        }
                    });
                    $scope.homeNavItems = homeNavItems;
                }
            };
        });
    };

});